import {PureComponent} from "react";
import {connect} from "../hoc";
import {fetchHomeMultiDataAction} from "../store/modules/home";

class Category extends PureComponent {

    componentDidMount() {
        this.props.fetchMultiData()
    }

    render() {
        const {count} = this.props;
        return (
            <div>
                <div>category组件count:{count} </div>
            </div>
        )
    }
}

const mapStateToProps = (state) => ({count: state.count.count})
const mapDispatchToProps = (dispatch) => ({
    fetchMultiData: () => dispatch(fetchHomeMultiDataAction({name: 'hhh'}))
})
export default connect(mapStateToProps, mapDispatchToProps)(Category)